{% extends 'default/base.html' %}
{% load paginator_tag %}
{% block content %}

    <style>
        .mail-date {
            width: 200px;
        }

        .mail-ontact {
            width: 100px;
        }
    </style>
    <div class="wrapper wrapper-content">
        <div class="row">
            {% include 'malfunction/left.html' %}
            <div class="col-lg-9 animated fadeInRight">
                <div class="mail-box-header">
                    {% include 'malfunction/search.html' %}
                    <h2>
                        待处理故障
                    </h2>
                </div>
                <div class="mail-box">

                    <table class="table table-hover table-mail">
                        <tbody>
                        <tr class="unread">
                            <td class="mail-subject">标题</td>
                            <td class="mail-ontact">业务负责人</td>
                            <td class="text-right mail-date">发现时间</td>
                            <td class="text-right">状态</td>
                        </tr>
                        {% for i in pagintor_obj %}
                            <tr class="read">
                                <td class="mail-subject"><a
                                        href="{% url 'malfunction_detail' pk=i.pk %}">{{ i.title }}</a></td>
                                <td class="mail-ontact">{{ i.projectuser }}</td>
                                <td class="text-right mail-date voilet">{{ i.scantime|safe }}</td>
                                <td class="text-right">
                                    {% ifequal   i.status 1 %}
                                        <i class="fa fa-exclamation-circle " style="color: #ff3842"></i>
                                    {% else %}
                                        <i class="fa fa-check-circle" style="color: #2ad49e"></i>
                                    {% endifequal %}
                                </td>
                            </tr>
                        {% endfor %}
                        </tbody>
                    </table>
                </div>
                <div class="voilet_page">
                    <div class="dataTables_paginate paging_simple_numbers" id="editable_paginate">
                        <ul class="pagination" style="margin-top: 0; float: right">
                            {% if pagintor_obj.has_previous %}
                                <li class="paginate_button previous" aria-controls="editable"
                                    tabindex="0" id="editable_previous">
                                    <a href="?page={{ pagintor_obj.previous_page_number }}">上一页</a>
                                </li>
                            {% else %}
                                <li class="paginate_button previous disabled"
                                    aria-controls="editable" tabindex="0" id="editable_previous">
                                    <a href="#">上一页</a>
                                </li>
                            {% endif %}

                            {% for page in pagintor_obj.paginator.page_range %}
                                {% pre_5_page pagintor_obj.number page %}
                            {% endfor %}

                            {% if pagintor_obj.has_next %}
                                <li class="paginate_button next" aria-controls="editable"
                                    tabindex="0" id="editable_next">
                                    <a href="?page={{ pagintor_obj.next_page_number }}">下一页</a>
                                </li>
                            {% else %}
                                <li class="paginate_button next disabled" aria-controls="editable"
                                    tabindex="0" id="editable_next">
                                    <a href="#">下一页</a>
                                </li>
                            {% endif %}
                        </ul>
                    </div>

                </div>
            </div>
        </div>
    </div>


{% endblock %}